package pers.mobian.aop;

import org.springframework.aop.ThrowsAdvice;

import java.lang.reflect.Method;

/**
 * @Date 2021/10/12 13:02
 * @Created mobian
 * @Description
 */

public class MoThrowsAdvice implements ThrowsAdvice {

	// 此处的异常类型需要进行指定 NullPointerException,该方法只能接受空指针异常的错误,如果项目是其他错误无法捕获
	// 如果想要捕获所有的异常 异常类型指定为Exception即可(具体详情参考ThrowsAdvice接口的注释)
	public void afterThrowing(Method method,Object[] objects,Object target,NullPointerException e){
		System.out.println("执行异常");
	}
}
